@layout("/common/_container.html"){
	<div class="header">
		授权信息
	</div>
	<div class="box_a">
		<div class="box_a_1">
		<div class="box_a_11"><span class="box_font">${accessInfo.appInfo}用户${accessInfo.name}将操作${accessInfo.notify}</span></div>
		<div class="box_a_12"><span class="box_subscription"></span></div></div>
	</div>
	<div class="box_d">
		<div class="box_d_1">
			<div class="example" >
				<div><h4 >授权给IP为：${accessInfo.clientIP}的设备</h4></div>
			</div>
		</div>
	</div>
	<div id="qrcode" class="qrcode"></div>
	<div class="box_d">
		<div class="box_d_1">
			<div class="example" >
				<div><h4 >请联系微信管理员${accessInfo.wxName}扫码授权</h4></div>
			</div>
		</div>
	</div>
	<script src="${ctxPath}/static/js/qrcode.js"></script>
    <script src="${ctxPath}/static/lib/jquery-3.3.1.min.js"></script>
	<script src="${ctxPath}/static/modular/packback/sysOptAccess/sys_opt_wx_access.js"></script>
	<script>
        var qrcode = new QRCode(document.getElementById("qrcode"), {
            width : 200,
            height : 200
        });

        function makeCode () {
            qrcode.makeCode("${url}");
        }

        makeCode();
        /**
         * 获取授权
         */
        SysOptAccessDlg.checkWxAccess = function() {

            this.clearData();
            this.collectData();

            //提交信息
            var ajax = new $ax(Feng.ctxPath + "/access/checkWxAccessRight" + "?accessCode=" + "${accessCode}", function(data){
                if(data.erroCode == 0) {
                    var referLink = document.createElement('a');
                    referLink.href = Feng.ctxPath + "${successUrl}" + "?accessCode=" + "${accessCode}";
                    document.body.appendChild(referLink);
                    referLink.click();
                }
            },function(data){

            });
            ajax.set(this.SysOptAccessData);
            ajax.start();
        }

        $(function() {
            ref = setInterval(function(){
                SysOptAccessDlg.checkWxAccess();
            },2000);//两秒查询一次
        });
	</script>
@}